package com.teamone.mobilewatch.accessor;

import java.util.ArrayList;

import com.teamone.mobilewatch.model.Patient;
import com.teamone.mobilewatch.model.PatientReadings;
/**
 * Interface to access datasource 
 */
public interface PatientWatchDataAccessor {
	/**
	 * Returns list of all patients
	 */
	ArrayList<Patient> getAllPatients() throws Exception;
	/**
	 * Returns patient instance
	 * 
	 * @param patientId
	 *            - id of the patient
	 */
	ArrayList<Patient> getPatient(int patientId) throws Exception;
	/**
	 * Returns patient readings records
	 * 
	 * @param patientId
	 *            - id of the patient
	 */
	ArrayList<PatientReadings> getPatientReadings(int patientId) throws Exception;
	/**
	 * Returns last patient readings record
	 * 
	 * @param patientId
	 *            - id of the patient
	 */
	PatientReadings getLastPatientReadings(int patientId) throws Exception;
	/**
	 * Returns state of the simulator
	 */
	boolean isSimulatorRunning() throws Exception;
	/**
	 * Starts simulator
	 */
	boolean startSimulator(int updatePeriod) throws Exception;
	/**
	 * Stops simulator
	 */
	boolean stopSimulator() throws Exception;

	/**
	 * Authenticates user
	 * @param userName - user name
	 * @param password - user password
	 * @return <true> if user is authenticated
	 * @throws Exception
	 */
	boolean authenticateUser(String userName, String password) throws Exception;
}
